<?php
/**
 * @package aloevera-biorun
 * @since aloevera-biorun 1.0
 */
?>

	<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
	
		<?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
		<div class="featured-post">
			<?php _e( 'Featured post', 'aloevera_biorun' ); ?>
		</div>
		<?php endif; ?>
            


<div class="clearfix" id="primary_block">

	<!-- right infos-->
	<div id="pb-right-column">
		<!-- product img-->
				<div id="image-block">
				<?php 
                                $shortcode = '[portfolio_slideshow id='.$post->ID.' slideheight=260]';   
                                echo do_shortcode($shortcode);
                                ?>

				</div>
				<br><br><br><br>
				<br><br><br><br><hr>
				<?php 
				if ( is_user_logged_in() ) {
						get_template_part( 'zone_ecommerce' );
					} else {
						echo '<a href="'.esc_url( home_url( '/' ) ).'/?page_id=1372" class="simpleCart_checkout hudbtn primary" style="color:#fff;">Bon de commande</a>';
					}
                                
                                ?>

				

	
		<!-- Boutons de partage sur Facebook et Twitter -->
                <br><br><div class="clear"></div><hr><div id="sharing">
                        <!-- AddThis Button BEGIN -->
                            <div class="addthis_toolbox addthis_default_style ">
                            <a class="addthis_button_preferred_1"></a>
                            <a class="addthis_button_preferred_2"></a>
                            <a class="addthis_button_preferred_3"></a>
                            <a class="addthis_button_preferred_4"></a>
                            <a class="addthis_button_compact"></a>
                            <a class="addthis_counter addthis_bubble_style"></a>
                            </div>
                            <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
                            <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=ra-5144bef31417cd97"></script>

                        <!-- AddThis Button END -->
		</div>
                <div class="clear"></div>
                <hr>
                
                <div class="label-qlte">
			<a href=" http://www.fvd.fr/">		
                            <img style="height:70px;" class ="icone-label" alt="FVD" src="<?php echo get_template_directory_uri(); ?>/imgs/icones/fvd.jpg">
			</a>		

			<a href="#">		
                            <img alt="iso9000" src="<?php echo get_template_directory_uri(); ?>/imgs/icones/iso9000.jpg">
			</a>
                         <a href="#">		
                            <img  alt="EPA" src="<?php echo get_template_directory_uri(); ?>/imgs/icones/garantie.jpg">
			</a>
                        <a href="#">		
                            <img  alt="EPA" src="<?php echo get_template_directory_uri(); ?>/imgs/icones/epa.jpg">
			</a>
                        <a href="#">		
                            <img alt="EPA" src="<?php echo get_template_directory_uri(); ?>/imgs/icones/oshas.jpg">
			</a>
                       
                </div>
        </div>

	<!-- left infos-->
	<div id="pb-left-column">
	<header class="entry-header">
                        
                        <?php wp_link_pages( array( 'Article précédent' => '<div class="page-links">' . __( 'Pages:', 'aloevera_biorun' ), 'Article suivnat' => '</div>' ) ); ?>

			
			<?php if ( is_single() ) : ?>
                            <h1 class="entry-title"><?php the_title(); ?></h1>
			<?php else : ?>
                            <h1 class="entry-title">
                                    <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'aloevera_biorun' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                            </h1>
			<?php endif;?>
			
	</header>

		<!-- Description tab -->
				<div class="txttab" id="description">
					<?php if ( is_search() ) : ?>
								<div class="entry-summary"><p><?php the_excerpt(); ?></p></div>
					<?php else : ?>
								<div class="entry-content">
										<p><?php the_content( __( 'En savoir plus <span class="meta-nav">&rarr;</span>', 'aloevera_biorun' ) ); ?></p>

								</div>
					<?php endif; ?>
				</div>

	</div>
</div>
            
            <br><br>

                <h2 class="productscategory_h2">7 autres produits dans la même catégorie :</h2>
            <br>
            <?php
                $all_other_cat_title .=  '<li><a href="#tabs-'. $category->cat_ID .'"><h2>'. $category->name .'</h2></a></li>';

                                        $all_other_cat_content .= '<div id="tabs-'. $category->cat_ID .'">';
                                                foreach (get_posts('cat='.$category->term_id) as $post) {
                                                    setup_postdata( $post );
                                                    $all_other_cat_content .= '<ol class="other_product"><li><span class="nom-produit"><h3><a href="'.get_permalink($post->ID).'">'.get_the_title().'</a></h3></span>';
                                                    $all_other_cat_content .= '<ol class="other_product_infos"><span class="image-produit"><a href="'.get_permalink($post->ID).'">'.get_the_post_thumbnail($post->ID, array(115,145) ).'</a></span>';
                                                    $all_other_cat_content .= '<span class="excerpt-produit">'.limit_words(get_the_excerpt(), '10').'</span></ol></li></ol>';
                                                }
                $all_other_cat_content .= '</div>';

                echo $all_other_cat_content;
            ?>
            <br><br>
            <div class="clear"></div>

                <!-- FOOTER -->
		<footer class="entry-meta">
		</footer><!-- .entry-meta -->
	</article><!-- #post -->
